// 存放发布模式的plugins
const prodPlugins = []
// 存放开发模式的plugins
const devPlugins = []
const devPresets = []
if (process.env.NODE_ENV === 'production') {
  console.log(process.env.NODE_ENV)
  prodPlugins.push('transform-remove-console')
} else {
  console.log(process.env.NODE_ENV)
  // element的按需导入
  devPlugins.push(['component', {
    libraryName: 'element-ui',
    styleLibraryName: 'theme-chalk'
  }])
  devPresets.push('@vue/cli-plugin-babel/preset')
}
// const prodPlugins = ['transform-remove-console']

module.exports = {
  presets: [
    ...devPresets
  ],
  plugins: [
    // [
    //   'component',
    //   {
    //     libraryName: 'element-ui',
    //     styleLibraryName: 'theme-chalk'
    //   }
    // ],
    ...devPlugins,
    ...prodPlugins
  ]
}
